document.observe('dom:loaded', function(){ new Tooltip({tooltip_element : 'label'}); new Policies_Ui_ClassLimits();});

/* 
* inspired by te following two sources
* http://www.tutorials.de/javascript-ajax/272558-ajax-liefert-html-und-javascript-zurueck-und-das-js-soll-sofort-ausgefuehrt-werden.html#post1410695
* http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml
*/
String.prototype.eval_js=function()
{
    d=document.createElement('div');
    d.innerHTML=this;
    c='';
    for(s=0;s<d.getElementsByTagName('script').length;++s)
    {
        if(d.getElementsByTagName('script')[s].innerHTML.length == 0)
        {
            fileref=document.createElement('script');
            fileref.setAttribute("type","text/javascript");
            fileref.setAttribute("src", d.getElementsByTagName('script')[s].src);
            document.getElementsByTagName("head")[0].appendChild(fileref);
        }
        else
            c+=d.getElementsByTagName('script')[s].innerHTML;
    }
    eval(c);
    delete d;
}

function elementsSupportsAttribute(element, attribute)
{
    var test = document.createElement(element);
    if(attribute in test)
        return true;
    else
        return false;
}
